<script>
	import store from '@/store'
	export default {
		globalData: {
			// 胶囊距上距离
			menuTop: 0,
			// 导航栏高度
			navBarHeight: 0,
			// 胶囊距右方间距（方保持左、右间距一致）
			menuRight: 0,
			// 胶囊距底部间距（保持底部间距一致）
			menuBotton: 0,
			// 胶囊高度（自定义内容可与胶囊高度保证一致）
			menuHeight: 0,
			// 状态栏高度
			statusBarHeight: 0,
			// 安全距离
			safeAreaHeight: 0,
			// 胶囊宽度
			menuWidth: 0,
			//屏幕宽度
			screenWidth: 0,
		},
		onLaunch(options) {
			uni.hideTabBar()
			const that = this;
			// 获取系统信息
			const systemInfo = uni.getSystemInfoSync();
			// 胶囊按钮位置信息
			const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
			// 导航栏高度 = 状态栏到胶囊的间距（胶囊距上距离-状态栏高度） * 2 + 胶囊高度 + 状态栏高度
			that.globalData.menuTop = menuButtonInfo.top - systemInfo.statusBarHeight;
			that.globalData.menuWidth = menuButtonInfo.width;
			that.globalData.navBarHeight = (menuButtonInfo.top - systemInfo.statusBarHeight) * 2 + menuButtonInfo.height +
				systemInfo.statusBarHeight;
			that.globalData.menuRight = systemInfo.screenWidth - menuButtonInfo.right;
			that.globalData.menuBotton = menuButtonInfo.top - systemInfo.statusBarHeight;
			that.globalData.menuHeight = menuButtonInfo.height;
			that.globalData.statusBarHeight = systemInfo.statusBarHeight;
			that.globalData.safeAreaHeight = systemInfo.safeAreaInsets.bottom;
			that.globalData.screenWidth = systemInfo.screenWidth;
			/* 获取openid */
			this.getOpenid()
			// https://yshj.fgw.henan.gov.cn/rq/file/c4ca4238a0b923820dcc509a6f75849b/202510211729158955620602/Arimo.ttf
			// https://yshj.fgw.henan.gov.cn/rq/file/c4ca4238a0b923820dcc509a6f75849b/202510211733499229676361/pmzd.ttf
			/* 加载外部字体 */
			// uni.loadFontFace({
			// 	global: true,
			// 	family: "ZDL",
			// 	source: 'url("https://yshj.fgw.henan.gov.cn/rq/file/c4ca4238a0b923820dcc509a6f75849b/202510211733499229676361/pmzd.ttf")',
			// 	success: () => {
			// 	},
			// 	scopes: ["webview", "native"],
			// })

		},
		onShow: function() {
			uni.hideTabBar()
			/* 获取消息通知 */

		},
		onHide: function() {

		},
		methods: {
			async getOpenid() {
				this.$store.dispatch('user/getWxOpenId').then((res) => {});
			},

		}
	};
</script>

<style lang="scss">
	// ===
	// === 注意：此处导入的css，会作用于全部.vue文件，请适量导入
	// ===
	@import '@/uni_modules/uview-ui/index.scss';
	@import "@/static/scss/quill.bubble.scss";
	@import "@/static/scss/quill.core.scss";
	@import "@/static/scss/quill.snow.scss";

	/* 解决小程序和app滚动条的问题 */
	/* #ifdef MP-WEIXIN || APP-PLUS */
	::-webkit-scrollbar {
		display: none;
		width: 0 !important;
		height: 0 !important;
		-webkit-appearance: none;
		background: transparent;
		color: transparent;
	}

	/* #endif */

	/* 解决H5 的问题 */
	/* #ifdef H5 */
	uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
		/* 隐藏滚动条，但依旧具备可以滚动的功能 */
		display: none;
		width: 0 !important;
		height: 0 !important;
		-webkit-appearance: none;
		background: transparent;
		color: transparent;
	}

	/* #endif */

	@font-face {
		font-family: 'pacifico';
		src: url('https://yshj.fgw.henan.gov.cn/rq/file/c4ca4238a0b923820dcc509a6f75849b/202509242020096409658274/gkai00mp-2.ttf');
	}
</style>